package com.framework.common.Enums;

/**
 * @author zhoubb
 * @version V1.0
 * @Date 2020/4/12 21:30
 * @since JDK 1.8
 */
public enum LoginTypeEnum {

    ACCOUNT("账号登录", "account"),
    SMS("短信登录", "sms"),
    WECHAT("微信小程序登录", "wechat");

    private final String name;

    private final String value;

    private LoginTypeEnum(String name, String value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public String getValue() {
        return value;
    }

    public static String getName(String value) {
        for (LoginTypeEnum e : LoginTypeEnum.values()) {
            if (e.getValue().equals(value)) {
                return e.getName();
            }
        }
        return null;
    }
}
